import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ${USER}
 * Date: ${YEAR}-${MONTH}-${DAY}
 * Time: ${TIME}
 */
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入数字");
        int input = scan.nextInt();
        int count = 0;
        while(input != 0){
            input &= (input - 1);
            count++;
        }
        System.out.println(count);
    }
}